package com.lmk.homework;

import javax.naming.PartialResultException;
import java.util.ArrayList;

public class Phone {
    String brand;
    int price;
    String color;


        public static void main(String[] args)
        {
            ArrayList<Phone>arr=new ArrayList<Phone>();

           addPhone(arr);
            print(arr);
        }
    private static void print(ArrayList<Phone> arr) {
        for(int i=0;i<arr.size();i++)
        {
            System.out.println(arr.get(i).brand+" "+arr.get(i).price+" "+arr.get(i).color);
        }

    }

    private static void addPhone(ArrayList<Phone> arr) {
        Phone p=new Phone();
        p.brand="小米";
        p.price=4564;
        p.color="白色";

        Phone ph=new Phone();
        ph.brand="oppo";
        ph.price=3000;
        ph.color="红色";

        Phone pho=new Phone();
        pho.brand="vivo";
        pho.price=3200;
        pho.color="绿色";

        arr.add(p);
        arr.add(ph);
        arr.add(pho);

    }


}
